package com.leetcode.June;

/**
 * @Description: 搜索插入位置
 * @Author: Mr.Fxy
 * @CreateTime: 2024-07-25 22:04
 */
public class seaInsert {
    public int searchInsert(int[] nums, int target) {
        int l = nums.length;
        int i = 0;
        while (i < l) {
            int m = (i + l) / 2;
            if (target > nums[m]) {
                i = m + 1;
            }else {
                l=m;
            }
        }
        return  i;
    }
}
